package com.scoressystem.service.impl;

import com.scoressystem.mapper.StudentMapper;
import com.scoressystem.pojo.Student;
import com.scoressystem.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
import java.util.Map;

@Service
public class StudentServiceImpl implements StudentService {

    @Resource
    StudentMapper studentMapper;

    @Override
    public List<Student> selectAllStudentsByPage(Map<String, Object> map) {
        return studentMapper.selectAllStudentsByPage(map);
    }

    @Override
    public long selectAllStudentsCount(Map<String, Object> map) {
        return studentMapper.selectAllStudentsCount(map);
    }

    @Override
    public int deleteStudentById(Integer studentNo) {
        return studentMapper.deleteStudentById(studentNo);
    }

    @Override
    public List<Student> getAllStudentsBySname(String studentName) {
        return studentMapper.getAllStudentsBySname(studentName);
    }

    @Override
    public int updateStudent(Student student) {
        return studentMapper.updateStudent(student);
    }

    @Override
    public int addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public Student getStudentById(Integer studentNo) {
        return studentMapper.getStudentById(studentNo);
    }

    @Override
    public Student getStudentByUser(Integer studentNo, String studentPwd) {
        return studentMapper.getStudentByUser(studentNo, studentPwd);
    }

    @Override
    public int updateStudentPass(Integer studentNo, String studentPwd) {
        return studentMapper.updateStudentPass(studentNo, studentPwd);
    }


}
